<?php

// [ 应用入口文件 ]
namespace think;

// 定义常量
define('HTTP_TYPE',((isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on') || (isset($_SERVER['HTTP_X_FORWARDED_PROTO']) && $_SERVER['HTTP_X_FORWARDED_PROTO'] == 'https')) ? 'https://' : 'http://');
define('HTTP_HOST'	, $_SERVER['HTTP_HOST'].'/');
define('HTTP_ROOT'	, $_SERVER['HTTP_HOST'].str_replace($_SERVER['DOCUMENT_ROOT'],"",str_replace("\\","/",__DIR__)).'/');
define('WEB_PATH'	, HTTP_TYPE.HTTP_ROOT);
define('SYS_PATH'	, __DIR__.'/');
define('CORE_PATH'	, SYS_PATH.'core/');

// 定义应用目录
define('APP_PATH', SYS_PATH . 'app' . DIRECTORY_SEPARATOR);
// 插件目录
define('PLUG_PATH', SYS_PATH . 'plugs' . DIRECTORY_SEPARATOR);

// 加载框架引导文件
require CORE_PATH . 'framework/base.php';
// 执行应用并响应
Container::get('app', [APP_PATH])->run()->send();